RoamingSettingsHelper with initial support for UserExtensionsDataStore#77
RoamingSettingsHelper with initial support for UserExtensionsDataStore#77shweaver-MSFT merged 37 commits intodevfrom
Conversation
|
Thanks shweaver-MSFT for opening a Pull Request! The reviewers will test the PR and highlight if there is any merge conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
|
@nmetulev I've made some changes to simplify the usage based on our last chat. I wasn't able to reduce the constructor parameters to zero, but I do have a method that makes it just as simple. The issue is that I need to make an async request to the Graph to get the current user for their id. That can't be done in the constructor of the helper, and I don't like mandating
What do you think? Interested to know if you have any other ideas for this. |
|
@nmetulev I goofed this royally! Looks I forgot to change branches when I manually merged the changes from the package shuffle. I'll fix it |
|
@nmetulev, I fixed up the bad merge. Sorry about that :/ |
nmetulev
left a comment
There was a problem hiding this comment.
Awesome
What do you think about moving the RoamingSettingsHelper to the Graph package instead of the Controls package? Is there a dependency to UWP?
| get => DataStore.Read<object>(key); | ||
| set | ||
| { | ||
| if (DataStore.KeyExists(key)) |
There was a problem hiding this comment.
if it doesn't exist, shouldn't it create the key?
There was a problem hiding this comment.
Ya, good point. I think it should.
There was a problem hiding this comment.
I agree - will you do that in this PR?
CommunityToolkit.Uwp.Graph.Controls/Helpers/RoamingSettings/RoamingSettingsHelper.cs
Outdated
Show resolved
Hide resolved
CommunityToolkit.Uwp.Graph.Controls/Helpers/RoamingSettings/RoamingSettingsHelper.cs
Outdated
Show resolved
Hide resolved
In spirit I 100% agree. The thing that gets in the way is the I'm losing sight of why I'm extending the @michael-hawker, what do you think? Do you have any strong convictions on why we should stick with |
|
I've created a new issue on WCT repo to migrate the ObjectStorage interfaces up to the *.Toolkit package to remove the Windows dependency. CommunityToolkit/WindowsCommunityToolkit#3903 Let's review this for now so I can get the OneDrive PR up next. Once the work is done in WCT, I'll update and migrate the RoamingSettings logic up to the *.Graph package, and out of the UWP package. |
nmetulev
left a comment
There was a problem hiding this comment.
Feel free to merge after addressing last comment
|
Fixed the last comment, merging now 🚀 |

Fixes #72
Fixes #73
Fixed #84
PR Type
What kind of change does this PR introduce?
What is the current behavior?
RoamingSettings has been deprecated by the platform. We need a replacement and the Graph works great for this.
What is the new behavior?
I've added a new
RoamingSettingsHelperclass that extendsIObjectStorageHelper. When constructed, aRoamingDataStoreenum value is passed in to determine which Graph based storage method to use. The developer can then interact with the helper instance to perform CRUD operations on the roaming settings key/value pairs.Their are additional parameters that can be used to configure the RoamingSettingsHelper:
SyncOnInit- Determines if the data should automatically sync immediately upon creation of the helper instance. Default true.AutoSync- Determines if the data should sync on every transaction or wait until theSyncmethod is called explicitly. Default true.PR Checklist
Please check if your PR fulfills the following requirements:
Other information
You must be signed in with the Msal provider for this to work. The mock endpoint will fail.